package com.gary.security.repository.impl;

import java.util.List;
import org.springframework.security.userdetails.UserDetails;

import com.gary.core.repository.DefaultRepositoryImpl;
import com.gary.security.entity.User;
import com.gary.security.model.UserInfo;
import com.gary.security.model.resource.Resource;
import com.gary.security.repository.AuthenticationRepository;


public class AuthenticationRepositoryImpl extends DefaultRepositoryImpl<UserInfo,User> implements AuthenticationRepository {

	@SuppressWarnings("unchecked")
	public List<UserDetails> getUsers(String rolePrefix) {
		return (List<UserDetails>) dao.execute(new UserCallback(rolePrefix));
	}
	
	@SuppressWarnings("unchecked")
	public List<Resource> getResources(String rolePrefix) {
		return (List<Resource>) dao.execute(new RescCallback(rolePrefix));
	}
}
